package com.study.graph.util;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesUtills {
	static Properties prop = new Properties();
	/**
	 * @param fileName file to load
	 * @return true or false
	 * 
	 */
	public static boolean loadFile(String fileName){
		try{
			InputStream in = new BufferedInputStream(new FileInputStream(fileName));
			prop.load(in);
			
		}catch(IOException e){
			e.printStackTrace();
			return false;
		}
		return true;
	}
	/**
	 * get value by key
	 * @param key
	 * @return value
	 */
	public static String getPropertyValue(String key){
		return prop.getProperty(key);
	}
}
